import React from 'react';
import ReactDOM from 'react-dom';
import reportWebVitals from './reportWebVitals';
import {
    HashRouter as Router,
    Switch,
    Route,
    Redirect
} from "react-router-dom";
import Admin from './Admin';
import Home from "./Home";
import './assets/iconfont/iconfont.css';
import './index.css';

ReactDOM.render(
    <Router>
        <Switch>
            <Route path='/home' render={routeProps => <Home {...routeProps} />} />
            <Route path='/admin' render={routeProps => <Admin {...routeProps} />} />
            <Redirect to='/404' />
        </Switch>
    </Router>,
  document.getElementById('root')
);

// If you want to start measuring performance in your app, pass a function
// to article results (for example: reportWebVitals(console.article))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
